#include <bits/stdc++.h>

using namespace std;

const int MAXN = 1e5+10;
const int inf = 0x3f3f3f3f;

int n,k,a[MAXN];
int val[MAXN<<7],lz[MAXN<<7],root = 1,nodenum = 1,ls[MAXN<<7],rs[MAXN<<7];

struct ST{
	int f[20][MAXN],lg[MAXN],p2[MAXN],minn = inf;
	void init(){
		for(int i = 2;i <= n;i++) lg[i] = lg[i/2]+1;
		p2[0] = 1;
		for(int i = 1;i <= 20;i++) p2[i] = p2[i-1]<<1;
		for(int i = 1;i <= n;i++) f[0][i] = a[i],minn = min(a[i],minn);
		for(int i = 1;i <= 20;i++)
			for(int j = 1;j + p2[i] - 1 <= n;j++)
				f[i][j] = min(f[i-1][j],f[i-1][j+p2[i-1]]);
	}
	int query(int l,int r){
		int k = lg[r-l+1];
		return min(f[k][l],f[k][r-p2[k]+1]);
	}
}T;

void spread(int &o,int l,int r){
	if(!o) o = ++nodenum;
	else return;
	ls[o] = rs[o] = 0; lz[o] = inf;
	if(r-l+1 >= n) val[o] = T.minn;
	else {
		int bl = (l-1)/n,br = (r-1)/n;
		if(bl == br){
			val[o] = T.query(l-bl*n,r-br*n);
		}else{
			val[o] = min(T.query(l-bl*n,n),T.query(1,r-br*n));
		}						 
	}
}

void pushdown(int o,int l,int r){
	if(lz[o] < inf){
		lz[ls[o]] = lz[o];
		lz[rs[o]] = lz[o];
		val[ls[o]] = lz[o];
		val[rs[o]] = lz[o];
		lz[o] = inf;
	}
}

void upd(int xl,int xr,int v,int &o = root,int l = 1,int r = n * k){
	int mid = (l+r)>>1;
	spread(o,l,r);
	if(l != r) {spread(ls[o],l,mid);spread(rs[o],mid+1,r);}
	if(xl == l && xr == r) {
		val[o] = v;	lz[o] = v;
		return;
	}
	pushdown(o,l,r);
	if(xr <= mid) upd(xl,xr,v,ls[o],l,mid);
	else if(xl > mid) upd(xl,xr,v,rs[o],mid+1,r);
	else upd(xl,mid,v,ls[o],l,mid),upd(mid+1,xr,v,rs[o],mid+1,r);
	val[o] = min(val[ls[o]],val[rs[o]]);
}

int query(int xl,int xr,int &o = root,int l = 1,int r = n * k){
	int mid = (l+r)>>1;
	spread(o,l,r);
	if(l != r) {spread(ls[o],l,mid);spread(rs[o],mid+1,r);}
	if(xl == l && xr == r) return val[o];
	pushdown(o,l,r);
	if(xr <= mid) return query(xl,xr,ls[o],l,mid);
	else if(xl > mid) return query(xl,xr,rs[o],mid+1,r);
	else return min(query(xl,mid,ls[o],l,mid),query(mid+1,xr,rs[o],mid+1,r));
}

int main (){
	scanf("%d %d",&n,&k);
	for(int i = 1;i <= n;i++) scanf("%d",&a[i]);
	T.init();
	lz[1] = inf;val[1] = T.minn;
	int q;scanf("%d",&q);
	while(q--){
		int op,l,r; scanf("%d %d %d",&op,&l,&r);
		if(op == 1){
			int k ;scanf("%d",&k);
			upd(l,r,k);
		}else{
			int ans = query(l,r);
			printf("%d\n",ans);
		}
	}
	return 0;
}
